import { ref } from 'vue'
import { defineStore } from 'pinia'
import { getHomeDataAPI } from '@/apis/home'
export const useHomeDataStore = defineStore('homeData', () => {
  // 导航列表的数据管理
  // state 导航列表数据
  const homeData = ref([])

  // action 获取导航数据的方法
  const getHomeData = async () => {
    const res = await getHomeDataAPI()
    homeData.value = res.data
  }

  return {
    homeData,
    getHomeData
  }
})
